home *** CD-ROM | disk | FTP | other *** search
/ PCMania 24 / PCMania CD24.nrg / pov24 / alhambra.inc next >
Encoding:
Text File  |  1994-09-07  |  12.6 KB  |  402 lines

  1. /*    PERSISTENCE OF VISION RAYTRACER
  2.  
  3.       ALHAMBRA.INC
  4.  
  5.       Por: SOCRATES RIZQUEZ 1994
  6.  
  7. ==========================================================================*/
  8. #include "shapes.inc"
  9.  
  10. #declare agua1 = texture{
  11.         pigment { color rgb <0.2,0.27,0.3> }
  12.         normal { waves 0.95 frequency 0.9 
  13.         scale 0.6 translate <15,0,30> }
  14.         finish { ambient 0.4 phong 0.8 reflection 0.7 }}
  15.  
  16. #declare agua2 = texture { 
  17.         pigment { color rgb <0.4,0.4,0.75> }
  18.         normal { wrinkles 1 scale .015 }
  19.         finish { ambient 0.4 phong 0.8 reflection 0.7 }}
  20.  
  21. #declare tejas =                               //para los tejados
  22.     texture { pigment { granite color_map {
  23.         [ 0.0 color rgb <1,1,1> ]
  24.         [ 0.2 color rgb <1,1,1> ]
  25.         [ 0.4 color rgb <0.45,0.45,0.45> ]
  26.         [ 0.6 color rgb <0.7,0.5,0.3> ]
  27.         [ 0.8 color rgb <0.5,0.4,0.3> ]
  28.         [ 1.0 color rgb <1,1,1> ] } scale 12 } 
  29.         finish { ambient 0.3 phong 0.75 }}
  30.     texture { pigment { gradient x color_map {
  31.         [ 0.0 color rgb <0,0,0> ]
  32.         [ 0.2 color rgb <0,0,0> ]
  33.         [ 0.2 color rgbf <0,0,0,1> ]
  34.         [ 0.2 color rgbf <0,0,0,1> ] } scale 2.75 }}
  35.  
  36. #declare piedra = texture {                    //para suelo de piedras
  37.     pigment { granite color_map {
  38.         [ 0.0 color rgb <1,1,1> ]
  39.         [ 0.1 color rgb <1,1,1> ]
  40.         [ 0.3 color rgb <0.4,0.5,0.3> ]
  41.         [ 0.5 color rgb <0.6,0.5,0.5> ]
  42.         [ 0.8 color rgb <0.4,0.4,0.4> ]
  43.         [ 1.0 color rgb <1,1,1> ] } scale 6 }
  44.     normal { wrinkles 0.9 scale 2 }
  45.     finish { ambient 0.4 phong 1 }}
  46.  
  47. #declare piedra2 = texture {                   //para fuente
  48.     pigment { granite color_map {
  49.         [ 0.0 color rgb <1,1,1> ]
  50.         [ 0.2 color rgb <0.8,0.6,0.5> ]
  51.         [ 0.5 color rgb <0.8,0.7,0.5> ]
  52.         [ 0.95 color rgb <0.7,0.7,0.5> ]
  53.         [ 1.0 color rgb <0.6,0.6,0.4> ] } scale 2.5 }
  54.     normal { bumps 0.5 scale .5 }
  55.     finish { ambient 0.25 phong 0.8 }}
  56.  
  57. #declare piedra3 = texture {                   //para columnas
  58.     pigment { color rgb <0.8,0.8,0.7> }
  59.     finish { ambient 0.3 phong 0.8 }}
  60.  
  61. #declare piedra4 = texture {                   //para arcos redondos
  62.     pigment { leopard color_map { 
  63.            [ 0.0 color rgb <0.7,0.6,0.5> ]
  64.            [0.4 color rgb <0.2,0.1,0.06> ]
  65.            [0.6 color rgb <0.4,0.35,0.2> ]
  66.            [0.7 color rgb <0.65,0.6,0.5> ] } scale 0.4 }
  67.     finish { ambient 0.3 }}
  68.  
  69. #declare piedra5 = texture {                   //para arcos cuadrados
  70.     pigment { granite color_map {                //   y escalones
  71.         [ 0.0 color rgb <0.6,0.55,0.45> ]
  72.         [ 0.8 color rgb <0.35,0.25,0.2> ] } scale 4 }
  73.     finish { ambient 0.3 phong 0.2 }}
  74.  
  75. #declare piedra6 = texture {                   //para cajon oscuro y caja
  76.     pigment { color rgb <0.25,0.2,0.1> }
  77.     finish { ambient 0.3 }}
  78.  
  79. #declare piedra7 = texture {               // para los leones    
  80.     pigment { color rgb <0.28,0.25,0.18> }
  81.     normal { wrinkles 0.5 scale 1.5 }
  82.     finish { ambient 0.3 phong 0.25 }}
  83.  
  84. #declare piedras = intersection {   
  85.     box { <-85,0,-140>,<85,4.3,140> }
  86.     object { Disk_Y scale <35,5,35> inverse }
  87.     box { <-85,-5,-3>,<85,5,3> inverse }
  88.     box { <-3,-5,-120>,<3,5,0> inverse }
  89.     texture { piedra }}
  90.  
  91. #declare escalon1 = intersection {
  92.     object { Disk_Y scale <40,5,40> }
  93.     object { Disk_Y scale <30,6,30> inverse }}
  94.  
  95. #declare escalon2 = object { Disk_Y scale <23,5,23> }
  96.  
  97. #declare escalon3 = union {
  98.     box { <-100,-5,95>,<100,5,120> }
  99.     box { <-30,-5,65>,<30,5,100> }
  100.     box { <-100,-5,-120>,<-80,5,100> }
  101.     box { <80,-5,-120>,<100,5,100> }
  102.     box { <-85,-5,-10>,<-35,5,10> }
  103.     box { <35,-5,-10>,<85,5,10> }
  104.     box { <-10,-5,-120>,<10,5,-35> }}
  105.  
  106. #declare escalon4 = union {
  107.     object { escalon1 }
  108.     object { escalon2 }
  109.     object { escalon3 }}
  110.  
  111. #declare escalones = intersection {
  112.     object { escalon4 }
  113.     box { <-110,-6,-3>,<-25,6,3> inverse }
  114.     box { <25,-6,-3>,<110,6,3> inverse }
  115.     box { <-3,-6,-125>,<3,6,-25> inverse }
  116.     texture { piedra5 }}
  117.  
  118. #declare agua = box { <-85,0,-150>,<85,4.2,140> 
  119.     texture { agua1 }
  120.     bounded_by { box { <-86,-1,-151>,<86,5,141> }}}
  121.  
  122. #declare suelo = union {
  123.     object { piedras }
  124.     object { escalones }
  125.     object { agua }}
  126.     
  127. #declare pecho = object { Disk_Z scale <1.5,1.5,1.25> 
  128.     translate <-4.5,3.3,0> }
  129.  
  130. #declare cabeza = object { Disk_Z scale <0.9,1.4,1.25> rotate z*304
  131.     translate <-5.2,6,0> }
  132.  
  133. #declare hueco = intersection {
  134.     box { <-6,-1,-2>,<0,3,2> }
  135.     plane { <1,0,0>,0 rotate -z*83 translate <-21.5,0,0> inverse }
  136.     plane { <1,0,0>,0 rotate -z*22 translate <-5.1,0,0> inverse }
  137.     plane { <1,0,0>,0 rotate -z*157 translate <-0.2,0,0> inverse }}
  138.  
  139. #declare cuerpo = intersection {
  140.     box { <-6,0,-1.25>,<0,4.7,1.25> }
  141.     plane { <1,0,0>,0 rotate -z*3 translate <-5.4,0,0> inverse }
  142.     plane { <1,0,0>,0 rotate -z*127 translate <5.1,0,0> inverse }
  143.     object { hueco inverse }}
  144.  
  145. #declare pie = intersection {
  146.     box {<-0.8,0,-1.25>,<0,0.8,1.25> }
  147.     plane { <1,0,0>,0 rotate -z*50 translate <-0.8,0,0> inverse }}
  148.  
  149. #declare cuello = intersection {
  150.     box {<-5.2,4.5,-1.25>,<-3,6.5,1.25> }
  151.     plane { <1,0,0>,0 rotate -z*165 translate <-2.2,0,0> inverse }}
  152.  
  153.  
  154. #declare leon1 = union {
  155.     object { pecho }
  156.     object { cabeza }
  157.     object { cuerpo }
  158.     object { cuello }
  159.     object { pie translate <-0.2,0,0> }
  160.     object { pie translate <-5.2,0,0> }}
  161.  
  162. #declare leon = intersection {
  163.     object { leon1 }
  164.     object { Disk_X scale <20,2.7,0.45> inverse }
  165.     translate <-8.5,0,0> texture { piedra5 } }
  166.  
  167. #declare fuente1 = difference {
  168.     object { Disk_Y scale <15,1,15> }
  169.     box { <-7.5,-4,-7.5>,<7.5,4,7.5> inverse }
  170.     box { <-7.5,-4,-7.5>,<7.5,4,7.5> rotate y*30 inverse }
  171.     box { <-7.5,-4,-7.5>,<7.5,4,7.5> rotate y*60 inverse }
  172.     bounded_by { object { Disk_Y scale <20,5,20> }} scale <1.25,2,1.25>
  173.     texture { piedra2 }}
  174.  
  175. #declare surt1 = object { torus { 4.3,0.18 } 
  176.     rotate x*90 translate <-30,2,0>
  177.     scale <0.75,2.13,0.7> 
  178.     bounded_by { sphere { <-30,2,0>,15 }}}
  179.     
  180. #declare surt2 = intersection {
  181.     object { surt1 }
  182.     plane { <1,0,0>,0 translate <-22.5,0,0> }
  183.     texture { agua2 }}
  184.  
  185. #declare fuente2 = union {
  186.     object { fuente1 translate <0,6.5,0> }
  187.     object { leon }
  188.     object { leon rotate y*30 }
  189.     object { leon rotate y*60 }
  190.       //object { leon rotate y*90 }
  191.     object { leon rotate y*120 }
  192.     object { leon rotate y*150 }
  193.     object { leon rotate y*180 }
  194.     object { leon rotate y*210 }
  195.     object { leon rotate y*240 }
  196.     object { leon rotate y*270 }
  197.     object { leon rotate y*300 }
  198.     object { leon rotate y*330 }
  199.     scale 1.5 translate <0,5.25,0> }
  200.  
  201. #declare surt = union {
  202.     object { surt2 }
  203.     object { surt2 rotate y*30 }
  204.     object { surt2 rotate y*60 }
  205.       //object { surt2 rotate y*90 }
  206.     object { surt2 rotate y*120 }
  207.     object { surt2 rotate y*150 }
  208.     object { surt2 rotate y*180 }
  209.     object { surt2 rotate y*210 }
  210.     object { surt2 rotate y*240 }
  211.     object { surt2 rotate y*270 }
  212.     object { surt2 rotate y*300 }
  213.     object { surt2 rotate y*330 }}
  214.  
  215. #declare surt3 = intersection { 
  216.     object { torus { 2,0.175 } rotate x*90 rotate y*35 
  217.         scale <1,5,1> translate <0,12,0> texture { agua2 }}
  218.     plane { y,12 inverse }
  219.     bounded_by { sphere { <0,12,0>,11 }}}
  220.  
  221. #declare fuente = union {
  222.     object { fuente2 }
  223.     object { surt }
  224.     object { surt3 }}
  225.  
  226. #declare columna = object { Disk_Y scale <0.6,15,0.6> translate <0,15,0>
  227.     bounded_by { 
  228.         object { Disk_Y scale <0.7,16,0.7> translate <0,15,0> }}}
  229.  
  230. #declare columna1 = union {
  231.     object { columna translate <-84,0,0> }
  232.     object { columna translate <-72.5,0,0> }
  233.     object { columna translate <-60,0,0> }
  234.     object { columna translate <-58,0,0> }
  235.     object { columna translate <-42,0,0> }
  236.     object { columna translate <-40,0,0> }
  237.     object { columna translate <-24.5,0,0> }
  238.     texture { piedra3 }}
  239.  
  240. #declare arco1 = union {
  241.     box { <-4.5,-15,-2>,<4.5,0,2> }
  242.     object { Disk_Z scale <4.5,4.5,2> }}
  243.  
  244. #declare arco2 = union {
  245.     box { <-6,-15,-2>,<6,0,2> }
  246.     object { Disk_Z scale <6,6,2> }}
  247.  
  248. #declare frontal1 = intersection {
  249.     box { <-85,28,-1>,<-24,60,1> }
  250.     object { arco1 translate <-78.5,40.5,0> inverse }
  251.     object { arco1 translate <-66.5,40.5,0> inverse }
  252.     object { arco2 translate <-50,39,0> inverse }
  253.     object { arco2 translate <-32,39,0> inverse }
  254.     bounded_by { box { <-86,27,-2>,<-23,61,2> }}
  255.     texture { piedra4 pigment { scale .7 }}}
  256.  
  257. #declare frontal2 = union {
  258.     box { <-85,30,-1.5>,<-82,60,1.5> }
  259.     box { <-75,30,-1.5>,<-70,60,1.5> }
  260.     box { <-63,30,-1.5>,<-55,60,1.5> }
  261.     box { <-45,30,-1.5>,<-37,60,1.5> }
  262.     box { <-27,30,-1.5>,<-24,60,1.5> }
  263.     box { <-85,57,-1.5>,<-24,61,1.5> }
  264.     bounded_by { box { <-86,29,-2>,<-23,62,2> }}
  265.     texture { piedra5 }}
  266.  
  267. #declare lateral = union {
  268.     object { columna1 }
  269.     object { frontal1 }
  270.     object { frontal2 }
  271.     box { <-85,61,-1.5>,<-24,70,1.5> texture { piedra6 }}}
  272.  
  273. #declare lateral1 = object { lateral translate <54.5,0,0> rotate y*90 }
  274.  
  275. #declare arcos = union {
  276.     object { lateral translate <0,0,100> }
  277.     object { lateral rotate y*180 translate <0,0,100> }
  278.     object { lateral1 translate <-86.5,0,68> }
  279.     object { lateral1 translate <86.5,0,68> }
  280.     object { lateral1 translate <-86.5,0,7> }
  281.     object { lateral1 translate <86.5,0,7> }}
  282.  
  283. #declare columna2 = union {
  284.     object { columna translate <-21,0,100> }
  285.     object { columna translate <-19.5,0,100> }
  286.     object { columna translate <-9,0,100> }
  287.     object { columna translate <9,0,100> }
  288.     object { columna translate <19,0,100> }
  289.     object { columna translate <21,0,100> }
  290.     texture { piedra3 }}
  291.  
  292. #declare arco3 = union {
  293.     box { <-4,-15,-2>,<4,0,2> }
  294.     box { <-2.828,-2.828,-2.828>,<2.828,2.828,2.828> 
  295.         rotate y*45 rotate x*90 scale <1,3,1> }}
  296.  
  297. #declare frontal3 = intersection {
  298.     box { <-23,28,99>,<23,60,101> }
  299.     object { arco3 translate <-14,38,100> inverse }
  300.     object { arco3 translate <-4,38,100> inverse }
  301.     object { arco3 translate <0,40,100> inverse }
  302.     object { arco3 translate <4,38,100> inverse }
  303.     object { arco3 translate <14,38,100> inverse }
  304.     bounded_by { box { <-24,27,98>,<24,61,102> }}  
  305.     texture { piedra4 pigment { scale 0.8 }}}
  306.  
  307. #declare frontal4 = union {
  308.     box { <-24,30,98.5>,<-17,60,101.5> }
  309.     box { <-11,30,98.5>,<-7,40,101.5> }
  310.     box { <7,30,98.5>,<11,40,101.5> }
  311.     box { <17,30,98.5>,<24,60,101.5> }
  312.     box { <-24,57,98.5>,<24,61,101.5> }
  313.     bounded_by { box { <-25,29,98>,<25,62,102> }}
  314.     texture { piedra5 }}
  315.  
  316. #declare frontal5 = union {
  317.     object { columna2 }
  318.     object { frontal3 }
  319.     object { frontal4 }}
  320.  
  321. #declare frontal = union {
  322.     object { frontal5 scale <.8,1,1> }
  323.     object { frontal5 translate <0,0,-15> scale <.9,1,1> }
  324.     object { frontal5 translate <0,0,-30> }
  325.     box { <23,50,70>,<24,70,100> }
  326.     box { <-24,61,68.5>,<24,70,110> texture { piedra6 }}}
  327.  
  328. #declare hor = intersection {
  329.     box { <-150,70,95>,<150,100,140> }
  330.     plane { <0,0,1>,0 rotate x*56 translate <0,71,95 > inverse }
  331.     bounded_by { box { <-151,69,94>,<151,101,141> }}
  332.     texture { tejas }}
  333.                       
  334. #declare izq = intersection {
  335.     box { <-125,70,-100>,<-80,100,150> }
  336.     plane { <1,0,0>,0 rotate z*56 translate <-80,71,0> }
  337.     bounded_by { box { <-126,69,-101>,<-79,101,151> }}
  338.     texture { tejas rotate y*90 }}
  339.  
  340. #declare der = intersection {
  341.     box { <80,70,-100>,<125,100,150> }
  342.     plane { <1,0,0>,0 rotate z*304 translate <80,71,0> inverse }
  343.     bounded_by { box { <79,69,-101>,<126,101,151> }}
  344.     texture { tejas rotate y*90 }}
  345.  
  346. #declare centro = intersection {
  347.     box { <-30,70,65>,<30,110,150> }
  348.     plane { <1,0,0>,0 rotate z*320 translate <-30,71,0> inverse }
  349.     plane { <1,0,0>,0 rotate z*40 translate <30,71,0> }
  350.     plane { <0,0,1>,0 rotate x*40 translate <0,71,65> inverse }
  351.     bounded_by { box { <-31,69,64>,<31,111,151> }}
  352.     texture { tejas }}
  353.  
  354. #declare tejado = union {
  355.     object { hor }
  356.     object { der }
  357.     object { izq }
  358.     object { centro }}
  359.  
  360. #declare torre1 = intersection {
  361.     box { <-40,125,-40>,<40,170,40> }
  362.     plane { <1,0,0>,0 rotate z*315 translate <-40,125.6,0> inverse }
  363.     plane { <1,0,0>,0 rotate z*45 translate <40,125.6,0> }
  364.     plane { <0,0,1>,0 rotate x*45 translate <0,125.6,-40> inverse }
  365.     bounded_by { box { <-41,124,-41>,<41,171,41> }}
  366.     texture { tejas }}
  367.  
  368. #declare torre = union {
  369.     object { torre1 }
  370.     box { <-40,124.9,-40>,<40,125,40> pigment { rgb <0,0,0> }}
  371.     box { <-33,70,-33>,<33,125,33> 
  372.     texture { piedra5 }}
  373.     bounded_by { box { <-41,69,-41>,<41,171,41> }} }
  374.  
  375. #declare caja = union {
  376.     box { <-96,0,109>,<96,70,110>
  377.         bounded_by { box { <-97,-1,108>,<97,71,111> }}}
  378.     box { <-96,0,-100>,<-95,70,110> 
  379.         bounded_by { box { <-97,-1,-101>,<-94,71,111> }}}
  380.     box { <95,0,-100>,<96,70,110>
  381.         bounded_by { box { <94,-1,-101>,<95,71,111> }}}
  382.     texture { piedra6 }}
  383.  
  384. #declare planta = union {
  385.     box { <-100,69.9,-100>,<-80,70,120> }
  386.     box { <-100,69.9,95>,<100,70,120> }
  387.     box { <80,69.9,-100>,<100,70,120> }
  388.     box { <-30,69.9,65>,<30,70,120> }
  389.     pigment { color rgb <0,0,0> }}
  390.  
  391. #declare patio = union {
  392.     object { suelo }
  393.     object { fuente }
  394.     object { arcos }
  395.     object { frontal }
  396. //    object { frontal rotate y*180 translate <0,0,20> }
  397.     object { tejado }
  398.     object { planta }
  399.     object { torre translate <-95,-5,205> }
  400.     object { torre translate <95,-5,205> }
  401.     object { caja }}
  402.